fix: include reuse-module initial data in @cap-js/postgres build - #1707
fix: include reuse-module initial data in @cap-js/postgres build#1707alex-bkmr-cbs wants to merge 1 commit into
Conversation
The postgres build task copied only the app-local db/data folder, dropping initial-data CSVs shipped by reuse packages from the gen/pg artifact. This made a fresh Postgres deployment inconsistent with `cds deploy` from source and with the HANA build task. Collect initial data across app + reuse modules via cds.deploy.resources() and write the merged per-entity union into gen/pg/db/data. Gated by a csvFileDetection option (default on) for parity with HANA; setting it to false restores the legacy local-only copy. Closes cap-js#1694 Signed-off-by: Alex <alexander.buchkremer@cbs-consulting.de>
There was a problem hiding this comment.
@chgeo / @swaldmann I assume that you have the same problem for the HANA build task. How do you merge the data there, given that initial data could be provided via yaml, json and not only csv. Could we somehow re-use your work in this build plugin for postgres rather than to re-invent the wheel?
There was a problem hiding this comment.
How do you merge the data there, given that initial data could be provided via
yaml,jsonand not onlycsv
Only csv files and handled by the HANA build. No support for other data formats so far.
The csv files themselves are not merged but just handed over to the HDI deployer. We have never wanted to merge data on a per-record basis, for build performance reasons, and to avoid confusion on which data gets effectively deployed.
The postgres build task copied only the app-local db/data folder, dropping
initial-data CSVs shipped by reuse packages from the gen/pg artifact. This made
a fresh Postgres deployment inconsistent with
cds deployfrom source and withthe HANA build task.
Collect initial data across app + reuse modules via cds.deploy.resources() and
write the merged per-entity union into gen/pg/db/data. Gated by a csvFileDetection
option (default on) for parity with HANA; setting it to false restores the legacy
local-only copy.
Closes #1694
Signed-off-by: Alex alexander.buchkremer@cbs-consulting.de